Remove check for overrideurl when migrating account.
authorCamila Ayres <hello@camilasan.com>
Thu, 16 Jan 2025 18:56:14 +0000 (19:56 +0100)
committerMatthieu Gallien <matthieu.gallien@nextcloud.com>
Tue, 11 Feb 2025 09:57:01 +0000 (10:57 +0100)
Signed-off-by: Camila Ayres <hello@camilasan.com>
src/gui/accountmanager.cpp

index 0a3c40cbc6dbee9965686e2c00fb972f1a1a265d..f89085664cedaf87e1b4048746cc1cff1dce9880 100644 (file)
@@ -240,41 +240,8 @@ bool AccountManager::restoreFromLegacySettings()
                     }
                 }
 
-                // Check the theme url to see if it is the same url that the oC config was for
-                const auto overrideUrl = Theme::instance()->overrideServerUrl();
-                const auto cleanOverrideUrl = overrideUrl.endsWith('/') ? overrideUrl.chopped(1) : overrideUrl;
-                qCInfo(lcAccountManager) << "Migrate: overrideUrl" << cleanOverrideUrl;
-
-                if (!cleanOverrideUrl.isEmpty()) {
-                    oCSettings->beginGroup(QLatin1String(accountsC));
-                    const auto accountsChildGroups = oCSettings->childGroups();
-                    for (const auto &accountId : accountsChildGroups) {
-                        oCSettings->beginGroup(accountId);
-                        const auto oCUrl = oCSettings->value(QLatin1String(urlC)).toString();
-                        const auto cleanOCUrl = oCUrl.endsWith('/') ? oCUrl.chopped(1) : oCUrl;
-
-                        // in case the urls are equal reset the settings object to read from
-                        // the ownCloud settings object
-                        qCInfo(lcAccountManager) << "Migrate oC config if " << cleanOCUrl << " == " << cleanOverrideUrl << ":"
-                                                 << (cleanOCUrl == cleanOverrideUrl ? "Yes" : "No");
-                        if (cleanOCUrl == cleanOverrideUrl) {
-                            qCInfo(lcAccountManager) << "Copy settings" << oCSettings->allKeys().join(", ");
-                            oCSettings->endGroup(); // current accountID group
-                            oCSettings->endGroup(); // accounts group
-                            settings = std::move(oCSettings);
-                            break;
-                        }
-
-                        oCSettings->endGroup();
-                    }
-
-                    if (oCSettings) {
-                        oCSettings->endGroup();
-                    }
-                } else {
-                    qCInfo(lcAccountManager) << "Copy settings" << oCSettings->allKeys().join(", ");
-                    settings = std::move(oCSettings);
-                }
+                qCInfo(lcAccountManager) << "Copy settings" << oCSettings->allKeys().join(", ");
+                settings = std::move(oCSettings);
 
                 ConfigFile::setDiscoveredLegacyConfigPath(configFileInfo.canonicalPath());
                 break;